#ifndef _TOOLBOX_H
#define _TOOLBOX_H

#include "Tool.h"
#include "global.h"
#include <vector>
#include "VSObject.h"
#include "HandInfoTable.h"

class ToolBox
{
public:
	ToolBox(void);
	~ToolBox(void);

public:
	void init();

	bool SelectTool(std::vector<VSObject>&,int handNo, TrackData * pObjectCurCtrl);
	void RenderTools();		
	VSObject RenderOperations(std::vector<VSObject> & objs);
	void AddSelectedObjs(VSObject obj){m_curSelectedObjs.push_back(obj);}

	void SelectGravityObject();
	void SelectColorObject();
	void SelectRGBChannel();
	void SelectMergeObject();

	bool getWaitingObj(){return m_bWaitingObj;}

	void RenderRGB();
	void RenderOK();
private:
	int initTexture(Image* img,char* filename);
	int selectOK(Point3D handPos);
	VSObject createObjDefPos();
	int getCreateShape();
	void clearBounding();

	VSObject RenderCreate();
	void RenderCreateObjects(std::vector<VSObject> & objs);
	void RenderGravity(std::vector<VSObject> & objs);
	void RenderColor(std::vector<VSObject> & objs);
	void RenderMerge(std::vector<VSObject> & objs);

	void setBounding(int menuIdx, bool b);

private:
	std::vector<Tool> m_toolObjs;
	int m_curAction;
	std::vector<VSObject> m_curSelectedObjs;
	float m_rgb[3];
	bool m_bOK;
	Tool m_okPos;
	int m_createTexID;
	int m_gravityTexID;
	int m_colorTexID;
	int m_mergeTexID;
	int m_okTexID;
	bool m_bWaitingObj;
};

#endif